using System.Web.Mvc;
using DevelopmentKit.Domain;
using DevelopmentKit.Extensions.SharpArch.DataContext;
using Microsoft.Practices.ServiceLocation;

namespace DevelopmentKit.Web.Controllers
{
    public class BaseController:Controller
    {
        private User _current;

        protected User Current
        {
            get {
                return _current ??
                       (_current = ServiceLocator.Current.GetInstance<IDataContext>().Get<User>(int.Parse(User.Identity.Name)));
            }
        }
    }
}